/**
 * Created by limeng on 16/8/31.
 */
delegateApp.controller("ArticleDetailCtrl", function ($scope, $rootScope, $http, $routeParams) {

    $scope.articleId = $routeParams.articleId;

    $scope.article = {};
    $scope.secondMotionList = [];
    $scope.secondMotionPageNo = 1;
    $scope.showMoreMotion = false;

    $http.get('/article/'
        + $scope.articleId
    ).success(
        function (data) {
            if (data.state == true) {
                $scope.article = data.article;
                var contentElem = document.getElementById("articleContent");
                contentElem.innerHTML = $scope.article.content;
                contentElem.style.padding = 15;
            } else {
                showAlert('查询失败', '原因是:'+data.result);
            }
        }
    ).error(
        function () {
            showAlert('查询失败', '请联系开发者进行维护');
        }
    );
});